<?php
$this->breadcrumbs=array(
	'Products'=>array('index'),
	$model->name,
);

$this->menu=array(
	array('label'=>'List Product', 'url'=>array('index')),
	array('label'=>'Create Product', 'url'=>array('create')),
	array('label'=>'Update Product', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Product', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Product', 'url'=>array('admin')),
);
?>

<?php echo CHtml::image($model->getImagePath(),'Image',array('width'=>100,'height'=>50)); ?><h1>View Product -  <?php echo $model->name; ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		array(
            'label' => 'Category',
            'value' => Category::model()->findByPk($model->category_id)->name,
        ),
		'name',
		array(
            'label' => 'status',
            'value' => ($model->status == 1) ? 'enable' : 'disable'
        ),
		array(
            'label' => 'Tax',
            'value' => Tax::model()->findByPk($model->tax_id)->percent.' %',
        ),
		'description',
		array(
            'label' => 'Created time',
            'value' => CHtml::encode(date('d/m/Y H:i:s', $model->created_time))
        ),
		'created_by',
		array(
            'label' => 'Modified time',
            'value' => ($model->modified_time == null) ? '' : CHtml::encode(date('d/m/Y H:i:s', $model->modified_time))
        ),
		'modified_by',
	),
)); ?>
